<ion-header>
  <ion-navbar>
    <ion-title>机器信息</ion-title>
    <ion-buttons end>
      <button (click)="presentPopover($event)">
        <ion-icon name="more"></ion-icon>
      </button>
    </ion-buttons>
  </ion-navbar>
</ion-header>

<ion-content padding class="machine-detail" style="padding:0px;">

  <ion-card class="custom-padding" style="margin: 0px;padding:0px;width:100%;">

    <ion-card-content class="custom-padding" style="padding:0px;">
      <form class="list" class="custom-padding">
        <ion-item class="small">
          <ion-label style="color:#000000;">名称：</ion-label>
          <ion-input type="text" [(ngModel)]="machine.name" #name="ngModel" name="name" required></ion-input>
        </ion-item>

        <ion-item class="small">
          <ion-label>是否上机</ion-label>
          <ion-toggle #isOnline="ngModel" [(ngModel)]="machine.isOnline" name="isOnline"></ion-toggle>
        </ion-item>

        <ion-item class="small">
          <ion-label style="color:#000000;">上机客户：</ion-label>
          <ion-input type="text" [(ngModel)]="machine.client" #account="ngModel" name="client"></ion-input>
        </ion-item>

        <ion-item class="small">
          <ion-label style="color:#000000;">上机时间：</ion-label>
          <ion-datetime displayFormat="HH:mm" [(ngModel)]="machine.startTime" #startTime="ngModel"
                        name="startTime"></ion-datetime>
        </ion-item>

        <ion-item class="small">
          <ion-label style="color:#000000;">下机时间：</ion-label>
          <ion-datetime displayFormat="HH:mm" [(ngModel)]="machine.endTime" #endTime="ngModel"
                        name="endTime"></ion-datetime>
        </ion-item>

        <ion-item class="small">
          <ion-label style="color:#000000;">机台参数：</ion-label>
          <ion-input type="text" [(ngModel)]="machine.params" #params="ngModel" name="params"></ion-input>
        </ion-item>

        <ion-item class="small">
          <ion-label style="color:#000000;">备注：</ion-label>
          <ion-input type="text" [(ngModel)]="machine.comment" #comment="ngModel" name="comment"></ion-input>
        </ion-item>

        <ion-item class="small">
          <ion-label style="color:#000000;">最后更新帐号：</ion-label>
          <ion-input type="text" [(ngModel)]="machine.lastEditor" #lastEditor="ngModel" name="lastEditor" disabled="true"></ion-input>
        </ion-item>

        <ion-item class="small">
          <ion-label style="color:#000000;">最后更新时间：</ion-label>
          <ion-input type="text" [(ngModel)]="machine.lastEditTime" #lastEditTime="ngModel" name="lastEditTime" disabled="true"></ion-input>
        </ion-item>

      </form>

    </ion-card-content>

  </ion-card>
  <button id="saveButton" class="button button-positive  button-block"
          (click)="onSaveMachine()">保存
  </button>
</ion-content>
